import random


class Player:
    def __init__(self, NUM_Custom):
        self.Name = '玩家'
        self.NUM_Custom = NUM_Custom
    def Gesture_Custom(self):
        if self.NUM_Custom == 1:
            print(f'{self.Name}出拳方式为：[石头]')
        elif self.NUM_Custom == 2:
            print(f'{self.Name}出拳方式为：[剪刀]')
        elif self.NUM_Custom == 3:
            print(f'{self.Name}出拳方式为： [布] ')


class Computer:
    def __init__(self, NUM_Random):
        self.Name = '人机'
        self.NUM_Random = NUM_Random
    def Gesture_Random(self):
        if self.NUM_Random == 1:
            print(f'{self.Name}出拳方式为：[石头]')
        elif self.NUM_Random == 2:
            print(f'{self.Name}出拳方式为：[剪刀]')
        elif self.NUM_Random == 3:
            print(f'{self.Name}出拳方式为： [布] ')


# 游戏类
class Game:
    print('请按对应编号选择您的出拳方式：\n1 [石头]\n2 [剪刀]\n3  [布]\n4 退出游戏\n'+'-' * 30)
    def Run(slef):
        while True:
            NUM_Custom = int(input('请选择您的出拳方式:'))
            person = Player(NUM_Custom)
            person.Gesture_Custom()
            NUM_Random = random.randint(1, 3)
            computer = Computer(NUM_Random)
            computer.Gesture_Random()
            if NUM_Custom == 1:
                if NUM_Random == 1:
                    print('本局平局')
                elif NUM_Random == 2:
                    print('本局玩家获胜')
                elif NUM_Random == 3:
                    print('本局电脑获胜')
            elif NUM_Custom == 2:
                if NUM_Random == 1:
                    print('本局电脑获胜')
                elif NUM_Random == 2:
                    print('本局平局')
                elif NUM_Random == 3:
                    print('本局玩家获胜')
            elif NUM_Custom == 3:
                if NUM_Random == 1:
                    print('本局玩家获胜')
                elif NUM_Random == 2:
                    print('本局电脑获胜')
                elif NUM_Random == 3:
                    print('本局平局')
            elif NUM_Custom == 4:
                print('游戏结束')
                break
            else:
                print('输入有误！')

            print('-' * 30)

Game.Run()